<template>
  <div class="musicPlayer">
    <div class="songInfo">
      <div>
        <div
          @click.self="fullScreen"
          class="van-ellipsis SongName"
          v-text="PlayingSongDetail.SongName"
        ></div>
        <div
          class="van-ellipsis SingerName"
          v-text="PlayingSongDetail.SingerName"
        ></div>
      </div>
    </div>
    <div class="controlPanel">
      <span
        class="glyphicon glyphicon-step-backward"
        @click="nextOrBefore('before')"
      ></span>
      <span class="glyphicon glyphicon-pause playBtn" @click="playMusic"></span>
      <span
        class="glyphicon glyphicon-step-forward"
        @click="nextOrBefore('next')"
      ></span>
    </div>
    <img v-lazy="PlayingSongDetail.picUrl" @click.self="fullScreen" />
    <audio id="audio" autoplay :src="PlayingSongDetail.url"></audio>
  </div>
</template>

<script>
export default {
  data: function () {
    return {};
  },
  props: ["PlayingSongDetail", "musicFlag"],
  methods: {
    playMusic() {
      this.$emit("playMusic");
    },
    fullScreen(){
        this.$emit("fullScreen")
    },
    nextOrBefore(flag) {
      this.$emit("nextOrBefore", flag);
    },
  },
};
</script>

<style scpoed lang="scss">
.musicPlayer {
  height: 55px;
  width: 100%;
  position: fixed;
  display: flex;
  bottom: 0;
  background: red;
  justify-content: space-between;
  .songInfo {
    position: absolute;
    div {
      margin: 0 0 0 10px;
    }
    .SongName {
      width: 200px;
      height: 20px;
      font-size: 12px;
      color: white;
    }
    .SingerName {
      margin-top: 5px;
      width: 80px;
      height: 20px;
      font-size: 8px;
      color: #eee;
    }
  }
  img {
    width: 55px;
    position: absolute;
    right: 30px;
    bottom: 25px;
    border-radius: 55px;
    box-shadow: 2px 1px 5px black;
  }
  .controlPanel {
    height: 55px;
    width: 100%;
    display: flex;
    justify-content: center;
    span {
      padding-top: 5px;
      font-size: 20px;
      margin: 0 10px;
      line-height: 55px;
      color: rgba(235, 235, 235, 0.945);
    }
  }
}
</style>